package org.pupil.register;

import org.pupil.common.constants.Register;
import org.pupil.spi.ExtensionLoader;

import java.io.IOException;


/**
 * @Description: 注册中心工厂
 * @Author: pupil
 * @Date: 2024/07/10 下午 10:07
 */
public class RegistryFactory {

    public static RegistryService get(Register register){
        return ExtensionLoader.getInstance().get(register.name);
    }

    public static RegistryService get(String name){
        return ExtensionLoader.getInstance().get(name);
    }

    public static void init() throws IOException, ClassNotFoundException {
        ExtensionLoader.getInstance().loadExtension(RegistryService.class);
    }
}
